<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <script src="//unpkg.com/vue/dist/vue.js"></script>
    <script src="//unpkg.com/element-ui@2.13.0/lib/index.js"></script>
    <style>
        @import url("//unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css");

        #app {
            width: 400px;
        }

        .b {
            position: relative;
            margin-bottom: 10px;
            width: 200px;
        }

        .b1 {
            position: absolute;
            left: 200px;
            width: 200px;
        }
    </style>
</head>

<body>
    <div id="vue">
        <el-button class="b" type="primary" style="padding: 30px;background-color: rgb(red, green, blue);" v-on:click="hide">登录</el-button>
        <el-button class="b1" type="primary" style="padding: 30px;background-color:lightgreen;" v-on:click="show">注册</el-button>
       
        
        <div id="app" >
                <el-form label-width="100px">
                    <el-form-item label="账号：">
                        <el-input type="text"></el-input>
                    </el-form-item>
                    <el-form-item label="密码：">
                        <el-input type="password"></el-input>
                    </el-form-item>
                    <div v-if="flag">
                        <el-form-item label="邮件：">
                            <el-input></el-input>
                        </el-form-item>
                    </div>
                    <el-form-item>
                        <el-button type="primary">提交</el-button>
                        <el-button>重置</el-button>
                    </el-form-item>
                </el-form>
            </div>
    </div>

    <script>
        let vue = new Vue({
            el: "#vue",
            data: {
                flag: true
            },
            //创建方法
            methods: {
                show: function () {
                    this.flag = false;
                },
                hide: function () {
                    this.flag = true;
                }
            }
        });
    </script>
</body>

</html>